\section{Description of Unicast functionality}
\tanke{Genbrugt i \ref{prestudy:identifyproblemandscenario:network:unicast}} \\
When using unicast the packages are send to only one receiver. Unicast enables handshake functionality, which ensures that the packages are only send when both transmitter and receiver are ready. Furthermore unicast allows acknowledgement packages that ensures that packages are retransmitted if necessary. These stability enhancements makes unicast considered reliable but they also require some additional transmission overhead which reduces the bandwidth.

\section{Description of Broadcast functionality}
\tanke{Genbrugt i \ref{prestudy:identifyproblemandscenario:network:broadcast}} \\
In a broadcast setting a packet is transmitted to all nodes on the network simultaneously. It is then up to each node to decide whether or not it wants the data. 
Broadcasting improves bandwidth of a network where one or more nodes requests the same data.
Broadcast is connectionless, which means that the overhead is smaller compared to unicast using a connection oriented protocol, e.g. the overhead of a UDP packet is 8 bytes and the minimum overhead of TCP packet is 20 bytes. 
Unlike unicast transmitting, broadcasting offers no native error control with the standardized connectionless protocols presently implemented in the OSI-model, which is why it in general is considered unreliable. 

\section{Broadcast Vs. Unicast network without network coding}

We will in the following determine the probability of packet loss in these setups:

\begin{itemize}
\item Unicast network
\item Unicast with retransmissions
\item Broadcast network
\item Broadcast with retransmissions
\item Broadcast network with network coding
\item Broadcast network with network coding and retransmissions
\end{itemize}

\subsection{Without packet loss}
When considering a scenario where a server is transmitting to a number of nodes through a wireless network where the probability of packet loss is 0, broadcasting becomes more efficient than unicasting when information should be transmitted to more than a single node. This is because the server, when unicasting, has to transmit the package to each individual node, while, when broadcasting, the server only has to transmit the package once. Therefore the number of packets, '$x_{total}$' the server has to send by unicasting to 'i' number of nodes is given by:


\begin{align}
x_{total} = i \g x
\intertext{Where:}
x_{total}&\text{ is the total send packets}\notag\\
x&\text{ is the number of unique packets to each node}\notag\\
i&\text{ is the number of nodes} \notag
\end{align}


\subsection{With packet loss}
\tanke{Genbrugt, med modificationer, i \ref{prestudy:identifyproblemandscenario:network:comparisonofunicastandbroadcast}} \\
When considering a more likely scenario where packet loss will happen the reliable connection of unicast will have a lower loss rate than the unreliable broadcast.
Unicast will automatically correct transmission error using the er flow and error control features of the common reliable connection oriented protocols, while broadcast will not because the unreliable network protocols doesn’t implement flow control and has only poor error control in the form of fx. a checksum. 
Although at transport layer stability enhancements such as Negative Acknowledgement, NAK, can be implemented, thus enabling package retransmission.

The probability of the nodes' success in receiving packets from the server is equal for both broadcasting and unicasting. The difference between them is that the total number of packages sent. 

The probability mass function is used to calculate the probability of success, $p_{success}$ when transmitting 'x' packets to 'n' nodes with 'r' retransmissions per packet with the success rate p.
 
\begin{align}
p_{success} &= \left(  \sum_{k=1}^{r+1} \frac{({r+1})!}{({r+1}-k)!k!} \g p^k \g (1-p)^{{r+1}-k}    \right)^{n \g x}
\intertext{Where:}
p_{success}&\text{ is probability that all nodes receiving at least one of each unique packet}\notag\\
x&\text{ is the number of unique packets to each node}\notag\\
n&\text{ is the number of nodes} \notag\\
r&\text{ is the number of retransmissions} \notag\\
p&\text{ is the probability that a node receives the transmitted packet} \notag
\end{align}

This probability describes the success rate for both broadcast with and without NAK. The reason why is that with NAK the number of retransmissions will converge to a constant which is why keeping retransmissions as a constant would make no difference in the overall success rate.

\textbf{Bandwidth consideration with unicast}\\
The total number of packets sent by the server will, in the case of unicasting where the nodes will request lost packets, be:

\begin{align}
x_{total} &= x \g ((r+1)+(r-1) \g n)
\intertext{Where:}
x_{total}&\text{ is the total number of sent packets from the server}\notag\\
x&\text{ is the number of unique packets to each node}\notag\\
n&\text{ is the number of nodes} \notag\\
r&\text{ is the number of retransmissions} \notag
\end{align}


\textbf{Bandwidth consideration with broadcast}\\
In the broadcast situation the total number of packets sent by the server is:

\begin{align}
x_{total} &= x \g (r+1)
\intertext{Where:}
x_{total}&\text{ is the total number of sent packets from the server}\notag\\
x&\text{ is the number of unique packets to each node}\notag\\
r&\text{ is the number of retransmissions} \notag
\end{align}

Notice that $x_{total}$, compared to the case of unicast, isn't dependent of the number of nodes. This is because it is assumed that the nodes aren't able to request lost packages. This means that the number of retransmissions should be wisely decided such that the possibility of packet loss is as close to 0 as possible. Doing that there will be lost packets but the chance of it would be very small and therefore acceptabel.